<?php
//exit(0);
set_time_limit(0);
//include("AllWeb.inc.php");


$arrWeb = array("luckyball.cc",
				"3d.usbet33.us",
				"chun.usbet33.us",
				"wb.uswin.us",
				"123.uswin.us",
				"new.uswin.us",
				"cl.uswin.us",
				"uswin99.us",
				"is.ubest.us",
				"us33.us",
				"us168.net",
				"union168.net",
				"fa.uswin.us",
				"don.uswin.us",
				"hk.uswin.us",
				"benz.ubest.us",
				"dl.ubest.us",
				"gi.uswin.us",
				"gun.uswin.us",
				"city.uswin.us",
				"sun.uswin.us",
				"chan.uswin.us",
				"top.ubest.us",
				"sky.uswin.us",
				"ly.uswin.us",
				"fan.ubest.us",
				"le.uswin.us",
				"fu.uswin.us",
				"mt.uswin.us",
				"gold.uswin.us",
				"cm668.com",
				"guan.uswin.us",
				"ho.uswin.us",
				"cai.uswin.us",
				"lo.uswin.us",
				"hi.uswin.us",
				"lan.uswin.us",
				"jia.uswin.us",
				"san.uswin.us",
				"gs.uswin.us",
				"river.uswin.us",
				"bs.ubest.us",
                "sg.ubest.us",
                "ok.ubest.us",
                "hd.ubest.us",
                "lb.ubest.us",
                "jc.ubest.us",
				"hk8.ubest.us",
				"li.ubest.us",
				"xuan.usbet33.us",
				"wr.ubest.us",
				"nw.ubest.us",
				"lo.ubest.us",
				"good.ubest.us",
				"sony.ubest.us",
				"gf.ubest.us",
				"gl.ubest.us",
				"sab.uswin.us",
				"yan.usbet33.us"
			);

//$arrWeb = array("luckyball.cc");

exec("rm -f /var/log/cronjob/lotto.addGLineLimit.log  &");
foreach($arrWeb as $strWeb){
	$pcid = pcntl_fork();
	if ($pcid == -1) {
		die("Could not fork!");
	}elseif ($pcid) {	//if ($pcid == -1)//
		print "There are $strWeb kids to terminate.".date("Y-m-d H:i:s")."\n";
	}else{	//if ($pcid == -1)//
		if (!posix_setsid()) { die ("Could not detach"); }; // detach
		print "I am child number ".$strWeb."Time: ".date("Y-m-d H:i:s")."\n";

		switch($strWeb){
			//case "3d.usbet33.us":
			//case "tien.usbet33.us":
			//case "union77.us":
			//	break;

			default:
				print exec("php -c / -f ./AddGambleTypeLimitForUser.php ".$strWeb." >> /var/log/cronjob/lotto.addGLineLimit.log  &");
				break;
		}
		exit();
	} //if ($pcid == -1)//
} //foreach($arrWeb as $strWeb)//

?>